import styles from './index.module.scss';
import Channels from '@/components/Channels';
import ArticleList from './components/ArticleList';
import { useAppSelector } from '@/store';
import { channelsType } from '@/store/reducer/channels';
export default function Home() {
  const { currentId, userChannels } = useAppSelector((state) => state.channels);

  return (
    <div className={styles.root}>
      <Channels />
      {userChannels.map((item: channelsType) => {
        return (
          <ArticleList
            key={item.id}
            channel_id={item.id}
            style={{ display: item.id === currentId ? 'block' : 'none' }}
          />
        );
      })}
    </div>
  );
}
